<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        table,table tr th, table tr td { border:1px solid blue; }
        table { width: 200px; min-height: 25px; line-height: 25px; text-align: center; border-collapse: collapse; padding:2px;}
    </style>
</head>
<body>
    <form action="/user/list">
        <label>姓名：</label>
        <input type="text" name="name">
        <input type="submit" value="查询">
    </form>
    <br>

    <a href="/user/toAdd">新增</a>
    <table>
        <tr>
            <th>ID</th>
            <th>姓名</th>
            <th>年龄</th>
            <th>操作</th>
        </tr>
        <tr th:each="user:${list}">
            <td th:text="${user.id}"></td>
            <td th:text="${user.name}"></td>
            <td th:text="${user.age}"></td>
            <td>
                <a th:href="@{/user/getUser/{id}(id=${user.id})}">查看</a>
                <a th:href="@{/user/delete/{id}(id=${user.id})}">删除</a>
            </td>
        </tr>
    </table>
</body>
</html>